home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NetNews Offline 2
/
NetNews Offline Volume 2.iso
/
news
/
comp
/
std
/
c
/
35
< prev
next >
Wrap
Internet Message Format
|
1996-08-06
|
2KB
Path: lyra.csx.cam.ac.uk!nmm1
From: nmm1@cus.cam.ac.uk (Nick Maclaren)
Newsgroups: comp.std.c,comp.lang.c
Subject: Re: K&R to ANSI converters
Date: 5 Jan 1996 20:31:28 GMT
Organization: University of Cambridge, England
Message-ID: <4ck1r0$1eo@lyra.csx.cam.ac.uk>
References: <4cjqt9$sjq@newsgate.sps.mot.com>
NNTP-Posting-Host: bootes.cus.cam.ac.uk
In article <4cjqt9$sjq@newsgate.sps.mot.com>, Kevin Brune <brune> wrote:
>I am looking for any tools (free, shareware or commercial) that
>would help me in a large K&R to ANSI C conversion/porting project.
>
>Any Web addresses or ftp site addresses would be appreciated. I
>am interested in tools that will run on UNIX platforms: (Sun under
>SunOS 4.1.3 or Solaris 2.5 and HP under HPUX 9.03) Thanks
>for your help!
You may be asking the impossible. Most clean K&R C will compile and run
correctly under an ANSI compiler, with very few (if any) changes. There
are three reasons that you might want to use such a converter:
1) To take clean K&R C and convert it to using prototypes, extra
casts, and so on. This should be feasible.
2) To take unclean K&R C and convert it to something that will
compile under an ANSI compiler.
3) To take unclean K&R C and fix up the semantic differences, so
that it executes correctly under an ANSI compiler.
The reason that I say that the latter two categories are unclean K&R
C is that 99% of the incompatibilities between K&R C and ANSI C are
things that no right-minded programmer would rely on. The reasons that
ANSI had to change them were precisely because different implementations
handled them differently and because they were virtually impossible to
define correctly.
I don't give you the chance of a flea in a furnace of finding any
utilities that will do the job without exposing you to the serious
risk of errors introduced by the translation. My experience of such
conversions is that I cannot even define general rules for conversion,
let alone work out how to program them! And I have done quite a lot
of this.
But there may well be something that will handle the first category.
Nick Maclaren,
University of Cambridge Computer Laboratory,
New Museums Site, Pembroke Street, Cambridge CB2 3QG, England.
Email: nmm1@cam.ac.uk
Tel.: +44 1223 334761 Fax: +44 1223 334679